<%def name="navbar()">
<div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">
            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <a class="brand" href="/index.html"><img src="/static/front/content/img/base/logo.png"/></a>
            <div class="nav-collapse">
                <ul class="nav">
                  <li><a href="/index.html">首页</a></li>
                  <li><a href="/coupons/list.html">优惠券</a></li>
                  <li><a href="/products/list.html">折扣商品</a></li>
                  <li><a href="#about">商家</a></li>
                  <li><a href="#contact">关于我们</a></li>
                  <li><a href="#contact">意见反馈</a></li>
                  <li><a style="width:260px;background-color:transparent;"></a></li>
                  %if not h.is_user_login(request):
                  <li class="btn-group">
                    <button class="btn btn-info" id="login">登陆</button>
                    <button class="btn" id="register">免费注册</button>
                  </li>
                  %endif
                </ul>
            </div><!--/.nav-collapse -->
        </div>
    </div>
</div>
<script>
$(document).ready(function(){
    $('#login').click(function(){
        window.location = '/user/login.html';
    })
    $('#register').click(function(){
        window.location = '/user/register.html';
    })
})
</script>
</%def>

<%def name="buyleftmenu()">
<div class="box">
<DIV class=allsort>
	<DIV class=mt>
		<STRONG>全部商品分类</STRONG>
	</DIV>
	<DIV class=mc>
        %for category in categories:
		<DIV class="item fore">
            <SPAN><H3><A href="/products/category${category.id}/list.html">${category.name}</A></H3><S></S></SPAN>
		</DIV>
        %endfor
        <!--
		<DIV class="item ">
		<SPAN><H3><A href="#">手机数码</A></H3><S></S></SPAN>
			<DIV class=i-mc>
				<DIV class=subitem>
					<DL class=fore>
					  <DT><A href="#">大 家 电</A></DT>
					  <DD><EM><A href="#">空调</A></EM>
					  <EM><A href="#">冰箱</A></EM>
					  <EM><A href="#">平板电视</A></EM>
					  <EM><A href="#">家电配件</A></EM>
					  <EM><A href="#">热水器</A></EM>
					  <EM><A href="#">洗衣机</A></EM>
					  <EM><A href="#">消毒柜</A></EM>
					  <EM><A href="#">烟机/灶具</A></EM>
					  <EM><A href="#">更多&gt;&gt;</A></EM>
					  </DD>
					  </DL>
					<DL>
				</DIV>
			</DIV>
		</DIV>
        -->
	</DIV>
</DIV>
</div>
<!--
<script>
    $(document).ready(function(){
        $(".allsort").hoverForIE6({current:"allsorthover",delay:200});
        $(".allsort .item").hoverForIE6({delay:150});
    })
</script>
-->
</%def>


<%def name="pagination(paginator)">
<div class="pagination pull-right">
    <ul>
        %if paginator.hasprevious:
        <li><a href="${paginator.get_page_url(request.url, paginator.previous)}">上一页</a></li>
        %else:
        <li class="active"><a>上一页</a></li>
        %endif

        %if paginator.current_index > 3:
        <li><a href="${paginator.get_page_url(request.url, 1)}">1</a></li>
        <li><a>...</a></li>
        %endif

        %for i in range(-2, min(paginator.pagecount - paginator.current_index + 1,3)):
        %if paginator.current_index+i > 0:
        %if i==0:
        <li class="active"><a>${paginator.current_index + i}</a></li>
        %else:
        <li><a href="${paginator.get_page_url(request.url, paginator.current_index+i)}">${paginator.current_index + i}</a></li>
        %endif
        %endif
        %endfor

        %if paginator.pagecount - paginator.current_index > 2:
        <li><a href="#">...</a></li>
        <li><a href="#">${paginator.pagecount}</a></li>
        %endif

        %if paginator.hasnext:
        <li><a href="${paginator.get_page_url(request.url, paginator.next)}">下一页</a></li>
        %else:
        <li class="active"><a>下一页</a></li>
        %endif
    </ul>
</div>
</%def>

<%def name="foot()">
 <div class="row foot">
         <div class="footwrapper">
            <div class="span2 no-margin">
                <h5>关于优惠券</h5>
                <ul class="no-margin">
                    <li><a href="#sf">优惠券使用</a></li>
                    <li><a href="#sf">优惠券使用</a></li>
                    <li><a href="#sf">优惠券使用</a></li>
                    <li><a href="#sf">优惠券使用</a></li>
                </ul>
            </div>
            <div class="span2">
                <h5>商品付款及配送</h5>
                <ul class="no-margin">
                    <li><a href="#sf">优惠券使用</a></li>
                    <li><a href="#sf">优惠券使用</a></li>
                    <li><a href="#sf">优惠券使用</a></li>
                    <li><a href="#sf">优惠券使用</a></li>
                </ul>
            </div>
            <div class="span2">
                <h5>合作共赢</h5>
                <ul class="no-margin">
                    <li><a href="#sf">优惠券使用</a></li>
                    <li><a href="#sf">优惠券使用</a></li>
                    <li><a href="#sf">优惠券使用</a></li>
                    <li><a href="#sf">优惠券使用</a></li>
                </ul>
            </div>
            <div class="span2">
                <h5>关于我们</h5>
                <ul class="no-margin">
                    <li><a href="#sf">优惠券使用</a></li>
                    <li><a href="#sf">优惠券使用</a></li>
                    <li><a href="#sf">电话:1348243258</a></li>
                    <li><a href="#sf">优惠券使用</a></li>
                </ul>
            </div>
        </div>
    </div>
</%def>
